import { Module } from '@nestjs/common';
import { FriendService } from './friend.service';
import { FriendController } from './friend.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Friend } from './entities/friend.entity';
import { UserModule } from '../user/user.module';
import { SocketGateway } from './socket.gateway';
import { Message } from './entities/message.entity';
// import { createClient } from 'redis';
import { Apply } from './entities/apply.entity';
@Module({
  imports: [UserModule, TypeOrmModule.forFeature([Friend, Message, Apply])],
  controllers: [FriendController],
  providers: [
    FriendService,
    SocketGateway,
    {
      provide: 'REDIS_CLIENT',
      async useFactory() {
        // const client = createClient({
        //   socket: {
        //     host: 'localhost',
        //     port: 6379,
        //   },
        // });
        // await client.connect();
        // return client;
      },
    },
  ],
})
export class FriendModule {}
